package com.cy.pj.common.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@NoArgsConstructor
public class JsonResult implements Serializable {
//    只要ID不变，不论该类结构如何改变，底层都会认为是同一个类
    private static final long serialVersionUID = 2047631119152611074L;
    private Integer state=1;
    private String message="ok";
    private Object data;

    public JsonResult(Object data){this.data=data;}

    public JsonResult(String message) {
        this.message = message;
    }

    public JsonResult(Throwable e) {
        this.state=0;
        this.message=e.getMessage();
    }

}
